Page({
  data: {
    detail: {}
  },

  onLoad(options) {
    // 获取传递过来的id
    const { id } = options;
    
    // 从缓存中获取轮播图数据
    const pages = getCurrentPages();
    const indexPage = pages[pages.length - 2]; // 获取上一页面(首页)
    if (indexPage) {
      const swiperList = indexPage.data.SwiperList;
      const detail = swiperList.find(item => item.id == id);
      if (detail) {
        this.setData({ detail });
        console.log(detail);
      } else {
        wx.showToast({
          title: '数据不存在',
          icon: 'error'
        });
      }
    }
  },
  openGUFEWebView() {
    wx.navigateTo({
      url: '/pages/webview/webview?url= https://rwb.gufe.edu.cn/' 
    });
   },
}); 